'''
https://leetcode.cn/problems/corporate-flight-bookings/description/
'''
from typing import List


class Solution:
    def corpFlightBookings(self, bookings: List[List[int]], n: int) -> List[int]:
        info = [0] * (n + 1)
        for first, last, seats in bookings:
            info[first] += seats
            info[last + 1] -= seats

        ans = [0] * n
        ans[0] = info[0]
        for i in range(1, n):
            ans[i] = ans[i-1] + info[i]
        return ans